package com.qimu.saiyou.model.enums;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 用户角色枚举
 *
 *@author: FeiXiang
 * 
 */
public enum QuestionTypeEnum {
    /**
     * 单选
     */
    RADIO("单选", 1),
    JUDGE("判断", 3),

    /**
     * 多种
     */
    MULTI("多选", 2),

    /**
     * 主观
     */
    SUBJECTIVE("主观", 4);

    private final String text;

    private final int value;

    QuestionTypeEnum(String text, int value) {
        this.text = text;
        this.value = value;
    }

    /**
     * 获取值
     * 获取值列表
     *
     * @return {@link List}<{@link Integer}>
     */
    public static List<Integer> getValues() {
        return Arrays.stream(values()).map(item -> item.value).collect(Collectors.toList());
    }

    public int getValue() {
        return value;
    }

    public String getText() {
        return text;
    }
}
